/**
 * 
 */
package br.ufal.ic.sd.project.server.enumeration;

import java.util.ArrayList;
import java.util.List;

/**
 * @author keven andrade
 *
 */
public enum RequestType {
    
    LOG(1,"LOG"),
    TOKEN(2,"TOKEN"),
    REPLICATION(3,"REPLICATION");
    
    private int intId;
    private String strDescription;
    
    /**
     * @Construtor
     * @param intId
     * @param strLogName
     */
    private RequestType(int intId, String strLogName) {
	
	this.intId = intId;
	this.strDescription = strLogName;
	
    }
    
    /**
     * @return a list of RequestType
     */
    public static List<RequestType> getListCommand() {

	List<RequestType> listRequestType = new ArrayList<RequestType>();
	int i = 1;

	while (RequestType.getCommand(i) != null) {
	    listRequestType.add(RequestType.getCommand(i++));
	}
	return listRequestType;
    }
    
    /**
     * @return a RequestType by is id
    */
    public static RequestType getCommand(int intId) {
	
	switch (intId) {
		case 1:
		    return RequestType.LOG;
		case 2:
		    return RequestType.TOKEN;
		case 3:
		    return RequestType.REPLICATION;
		default:
		    return null;
	}
    }

    /**
     * @return the intId
     */
    protected int getIntId() {
        return intId;
    }

    /**
     * @param intId the intId to set
     */
    protected void setIntId(int intId) {
        this.intId = intId;
    }

    /**
     * @return the strDescription
     */
    public String getStrDescription() {
        return strDescription;
    }

    /**
     * @param strDescription the strDescription to set
     */
    public void setStrDescription(String strDescription) {
        this.strDescription = strDescription;
    }
    
    

}
